<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<h1>函数</h1>
		
		<button onclick="sayHello()">点我</button>
		<script type="text/javascript">
			//1.函数定义：函数关键词  函数名  (参数) {作用域}
			function sayHello(){
				console.log("你好~~~");
				console.error("你好~~~");
				console.warn("你好~~~");
				console.debug("你好~~~");
			}
			
			//2.函数调用:直接写函数名称即可
			sayHello();
			//多次调用函数
			sayHello();
			
			//课堂练习:说一百次"我爱你~"
			for (var i = 0; i < 100; i++) {
				sayHello();
			}
		</script>
	</body>
</html>
